package com.wlsk.license.service.esign;

import com.alibaba.fastjson.JSONObject;
import com.timevale.esign.sdk.tech.bean.OrganizeBean;
import com.timevale.esign.sdk.tech.bean.PosBean;
import com.timevale.esign.sdk.tech.bean.SignPDFFileBean;
import com.timevale.esign.sdk.tech.bean.result.AddSealResult;
import com.timevale.esign.sdk.tech.bean.result.FileDigestSignResult;
import com.timevale.esign.sdk.tech.bean.result.Result;
import com.timevale.esign.sdk.tech.bean.seal.OrganizeTemplateType;
import com.timevale.esign.sdk.tech.bean.seal.SealColor;
import com.timevale.esign.sdk.tech.impl.constants.OrganRegType;
import com.timevale.esign.sdk.tech.impl.constants.SignType;
import com.timevale.esign.sdk.tech.service.AccountService;
import com.timevale.esign.sdk.tech.service.SealService;
import com.timevale.esign.sdk.tech.service.UserSignService;
import com.timevale.esign.sdk.tech.v3.client.ServiceClient;
import com.timevale.esign.sdk.tech.v3.client.ServiceClientManager;
import com.timevale.tech.sdk.bean.HttpConnectionConfig;
import com.timevale.tech.sdk.bean.ProjectConfig;
import com.timevale.tech.sdk.bean.SignatureConfig;
import com.timevale.tech.sdk.constants.AlgorithmType;
import com.timevale.tech.sdk.constants.HttpType;

public class ESignDemo {


    public static void main(String[] args) {
        registClientService();
        createOrg();
       // userSign();
    }

    public static void userSign() {
        ServiceClient getKHD = ServiceClientManager.get("7438802536");
        // 平台用户PDF摘要签署服务
        UserSignService userSignService = getKHD.userSignService();
        /**
         * 平台用户PDF摘要签署
         */
        // 签署文档信息
        SignPDFFileBean file = new SignPDFFileBean();
        file.setSrcPdfFile("D:/template/test.pdf");// 待签署PDF文档本地路径，含文档名（与bytes至少有一个不为空）
        file.setDstPdfFile("D:/template/test-sign.pdf");// 签署后PDF文档本地路径，含文档名（为空时返回签署后的文件流）
 //       file.setFileName("b");// 文档名称，e签宝签署日志对应的文档名，若为空则取文档路径中的名称
        file.setShowImage(false);// 是否增加e签宝logo图标

        // 签章位置信息
        PosBean signPos = new PosBean();
        signPos.setPosType(0);// 定位类型，0-坐标定位，1-关键字定位，默认0，SignType为关键字签署的时候，为1，否则为0。用户可以不作处理。此处只是为了兼容旧版本而保留
        signPos.setPosPage("1");// 签署页码，若为多页签章，支持页码格式“1-3,5,8“，若为坐标定位时，不可空
        signPos.setPosX(400L);// 签署位置X坐标，若为关键字定位，相对于关键字的X坐标偏移量，默认0
        signPos.setPosY(600L);// 签署位置Y坐标，若为关键字定位，相对于关键字的Y坐标偏移量，默认0
        // signPos.setCacellingSign(true);//是否是作废签签署，默认为false;如果签署作废章的话，建议线下也签署一份作废协议，这样法律效力较高
        signPos.setAddSignTime(false);// 是否显示本地签署时间，需要width设置92以上才可以看到时间

        String sealData = "iVBORw0KGgoAAAANSUhEUgAAAcQAAAHECAYAAACnX1ofAAAYkElEQVR42u3dSXIjSRIFUd7/bH2nrj0lQcTg5m7DUxFuurNIwIav4UEC+PkBsJX///z878qXSgEASoss45fuAQDGSI8oAQCkR5YAAOIjSwAA+REkABCgL4IEAAL0RZAAQIC+CBIASNAXQQIAAfoiSAAgQV/ECAAkOC3k1YocARChQNYHcgRAgsJWv/QLgFAVonqqpwAEppDUe30HIAwFoZkwEwAEnrAzL2YFgGATaubIDAEQYMLLfJktAIJKSJk5MwdAKAkkmEUA48NH9UGMAMaGjcrDhRsAIgTMMICJIaLqMNcAxgaGioMYARAhYPYBTAwD1YZdsAvA6ABQadgNuwFYdsCu2BXAcgN2x94AFhqwR/YIsMCAvbJTABEC9syOAZYUsHN2Dmi8lKoL2EHA1SkAYgQsHoBs+6mygGUD7KldBSwYYG/tLGCpADtsfwGLBNhl+wxYHsBu22vAwgB23J4DPxYEsO92HhbDYgD23+7DMlgGQA7IAlgCCwBAJsDQG3oA8gGG3bADkBUw4AYcgMyAwTbUAEgRBtowA5AjMMCGGAApwuAaXACyBQbWwAJIlzMqCTIEIG9kDQwnALkjd2AoAcggGQSDCEAWySIYQAAySSbB4AGQTbIJSQdOFQGQIgwZAMgrGC4AkFswVAAgvzB7oFQR+L5bKkKKIEMgZHYr7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/AASroNUbvQFAjt2+1JgIAUBw+yJBACBGXyQIAATpiwQBgCB9ESAAkKMvAgQAgvRFgABAkL4IEAAI0hcBAgBREh8AgCyJDwBAlKQHAEBmgao8sIb/ADZYxXWf5cV+AAAAAElFTkSuQmCC";

        FileDigestSignResult fileDigestSignResult = userSignService.localSignPDF("58C005991E2645D1878DC9DC8E7BBB59",
                sealData, file, signPos, SignType.Single);
        if (fileDigestSignResult.getErrCode() != 0)
            System.out.println("平台用户PDF摘要签署失败：" + JSONObject.toJSONString(fileDigestSignResult));
        else
            System.out.println("平台用户PDF摘要签署成功" + JSONObject.toJSONString(fileDigestSignResult));
    }

    public static void createOrg() {
        ServiceClient getKHD = ServiceClientManager.get("7438802536");
        AccountService service = getKHD.accountService();
        OrganizeBean organizeBean = new OrganizeBean();
        organizeBean.setName("陕西如高电气有限公司");
        organizeBean.setRegType(OrganRegType.MERGE);
        organizeBean.setOrganCode("91610131322424287L");
        organizeBean.setUserType(0);
        createSeal(service.addAccount(organizeBean).getAccountId());
    }

    public static void createSeal(String accountId) {
        ServiceClient getKHD = ServiceClientManager.get("7438802536");
        SealService sealService = getKHD.sealService();
        AddSealResult addSealResult = sealService.addTemplateSeal(accountId, OrganizeTemplateType.STAR, SealColor.RED, null, null);
        System.out.println(addSealResult.getSealData());
    }

    /**
     * 注册客户端
     */
    public static void registClientService() {
        Result rst = ServiceClientManager.registClient(getProjectCfg(), getHttpConCfg(), getSignatureCfg());
        // 注册客户端结果
        if (rst.getErrCode() != 0) {
            System.out.println("注册客户端失败"+rst.getMsg());
        }
    }

    /**
     *
     * description 进行项目配置，如果是测试环境，请联系E签宝交付顾问获取
     */
    public static ProjectConfig getProjectCfg() {
        ProjectConfig proCfg = new ProjectConfig();
        // 项目ID（应用ID）
        proCfg.setProjectId("7438802536");
        // 项目Secret(应用Secret)
        proCfg.setProjectSecret("53a21afbf7680f5572eec82940e592a1");
        // 开放平台地址
        // 需要添加ip白名单，而且添加之后需要等五分钟之后才能生效，否则会报错：接口调用方尚未配置ip白名单，请联系e签宝管理员配置
        // 正式环境请求地址：http://openapi.tsign.cn:8080/tgmonitor/rest/app!getAPIInfo2
        // 测试环境请求地址：http://smlitsm.tsign.cn:8080/tgmonitor/rest/app!getAPIInfo2
        proCfg.setItsmApiUrl("https://smlitsm.tsign.cn:8083/tgmonitor/rest/app!getAPIInfo2");
        return proCfg;
    }

    /**
     *
     * description http配置
     */
    private static HttpConnectionConfig getHttpConCfg() {
        HttpConnectionConfig httpConCfg = new HttpConnectionConfig();
        // 代理服务IP配置
        httpConCfg.setProxyIp(null);
        // 代理服务端口
        httpConCfg.setProxyPort(null);
        // 协议类型，默认Https
        httpConCfg.setHttpType(HttpType.HTTPS);
        // 请求失败重试次数，默认5次
        httpConCfg.setRetry(null);
        //连接超时时间配置，最大不能超过30秒
        httpConCfg.setTimeoutConnect(30);
        // 请求超时时间，最大不能超过30
        httpConCfg.setTimeoutRequest(30);
        // 代理服务器登录用户名
        httpConCfg.setUsername(null);
        // 代理服务器登录密码
        httpConCfg.setPassword(null);
        return httpConCfg;
    }

    /**
     * description 签名配置
     */
    private static SignatureConfig getSignatureCfg() {
        SignatureConfig signCfg = new SignatureConfig();
        signCfg.setAlgorithm(AlgorithmType.HMACSHA256);

        // 若算法类型是RSA，需要设置e签宝公钥和平台私钥
		/*signCfg.setEsignPublicKey(null);
		signCfg.setPrivateKey(null);*/

        return signCfg;
    }
}
